package com.leejw.tradeblogsystem.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.leejw.tradeblogsystem.common.Result;
import com.leejw.tradeblogsystem.mapper.SharesMapper;
import com.leejw.tradeblogsystem.model.Shares;
import com.leejw.tradeblogsystem.service.SharesService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author: jwli3
 * @Desc:
 * @create: 2024-08-23
 **/
@Service
public class SharesServiceImpl extends ServiceImpl<SharesMapper, Shares> implements SharesService {
    @Autowired
    private SharesMapper sharesMapper;

    @Override
    public Result addFavorite(Shares shareVO) {
        Shares shares = new Shares();
        BeanUtils.copyProperties(shares,shareVO);
        shares.setStatus("1");
        shares.setReason(shareVO.getReason());
        updateById(shares);
        return Result.success(shares);
    }
}
